package java7.methodHandle;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;

public class Basic {
	public static void main(String[] args) {
		MethodHandle mh=null;
		MethodType type = MethodType.methodType(void.class);
		try {
			mh = MethodHandles.lookup().findVirtual(Basic.class, "cannotInvoke", type);
		} catch (NoSuchMethodException | IllegalAccessException e) {
			e.printStackTrace();
		}
		try {
			mh.invokeExact(new Basic());
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}
	
	@SuppressWarnings("unused")
	private void cannotInvoke() {
		System.out.println("invoked???");
	}
}
